package me.example.web.sattic;

import java.util.function.Function;

/**
 * Created by junli on 2017/9/6.
 */
public class DefaultInterfaceImpl implements DefaultInterface{

    @Override
    public int addNum(int num1, int num2) {
        return num1 + num2;
    }

    public static void main(String[] args) {
        //测试默认接口
        DefaultInterfaceImpl defaultInterface = new DefaultInterfaceImpl();
//        System.out.println(defaultInterface.addNum(1,2));
//        System.out.println(defaultInterface.rideNum(2,3));

        //测试方法接口
        FunctionInterface<String,Integer> func = param -> Integer.valueOf(param);
        Integer result = func.getResult("2");
    //    System.out.println(result);

        Function<String, String> fun=(str)->"hello,"+str;
        String str=fun.apply("hello");
        System.out.println(str);

        Function<String,Integer> toInteger = Integer::valueOf;


        System.out.println(toInteger.apply("3"));





    }


}
